package com.scut.fy.auth.feign;

import com.scut.fy.auth.feign.fallback.SysRoleServiceFallback;
import com.scut.fy.common.web.util.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author JY
 * @version 1.0
 * @date 2021/9/6
 */
@FeignClient(name = "fy-admin", fallback = SysRoleServiceFallback.class)
public interface SysRoleService {

    /**
     * 通过用户名查询用户权限
     * @param userName
     * @return
     */
    @PostMapping("/sysRole/findByUserName")
    HttpResult<List<Map<String, Object>>> findRolesByUserName(@RequestParam("userName") String userName);

    /**
     * 通过用户id查询用户权限
     * @param userId
     * @return
     */
    @PostMapping("/sysRole/findByUserId")
    HttpResult<List<Map<String, Object>>> findRolesByUserId(long userId);
}
